function storeTutorial(tutorialId) {
    $.ajax({
        url: "/Origami/stored",
        data: {tutorialId: tutorialId},
        type: "post",
        dataType: "json",
        async: false,
        complete: function (data) {
            if (data.responseText == 'success') {
                $("#" + tutorialId).html("<span class='glyphicon glyphicon-star'></span>&nbsp;<a href " +
                    "= 'javascript:unStoreTutorial(" + tutorialId + ")' style = 'color: #999999'>取消收藏</a >")
            } else {
                alert("收藏失败")
            }
        }
    })
}


function unStoreTutorial(tutorialId) {
    $.ajax({
        url: "/Origami/unStored",
        data: {tutorialId: tutorialId},
        type: "post",
        dataType: "json",
        async: false,
        complete: function (data) {
            if (data.responseText == 'success') {
                $("#" + tutorialId).html("<span class='glyphicon glyphicon-star-empty'></span>&nbsp;<a href " +
                    "= 'javascript:storeTutorial(" + tutorialId + ")' style = 'color: #999999'>收藏</a >");
            } else {
                alert("取消收藏失败")
            }
        }
    })
}


function unStoreTutorialForMyCollection(tutorialId) {
    $.ajax({
        url: "/Origami/unStored",
        data: {tutorialId: tutorialId},
        type: "post",
        dataType: "json",
        async: false,
        complete: function (data) {
            if (data.responseText == 'success') {
                $("#" + tutorialId+"_all").hide();
            } else {
                alert("取消收藏失败")
            }
        }
    })
}